package tgc.edu.exam.service;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import tgc.edu.exam.custom.CommonService;
import tgc.edu.exam.entity.Student;
import tgc.edu.exam.entity.TbClass;
import tgc.edu.exam.repository.StudentRepository;

@Service
public class StudentService extends CommonService<Student, UUID>{
	@Autowired
	private StudentRepository studentdao;
	
	public void saves(Student studententity) {
		studentdao.save(studententity);
	}

	public Student findByUsername(String idcode) {
		return studentdao.findByUsername(idcode);
	}

	public List<Student> findByTbClassId(UUID id) {
		return studentdao.findByTbClassId(id);
	}

	public List<Student> Grouping(TbClass tbCl) {
		return studentdao.Grouping(tbCl);
	}

	public List<Student> findByTbClassId(Sort by, UUID id) {
		return studentdao.findByTbClassId(by, id);
	}

	public List<Student> findByTbClassIdAndIsUsed(UUID fromString, boolean b) {
		return studentdao.findByTbClassIdAndIsUsed(fromString, b);
	}

//	public List<Student> findByTbClassIdOrderByWorkUnitSexNation(UUID id, String string, String string2, String string3) {
//		return studentdao.findByTbClassIdOrderByWorkUnitSexNation(id, string, string2, string3);
//	}

//	public List<Student> findByTbClassIdAndSort(UUID id, Sort sort) {
//		return studentdao.findByTbClassIdAndSort(id, sort);
//	}

}
